package com.lhd.action.iterator;

/**
 * @Author: liuhd
 * @Date: 2024/12/19 13:40
 * @Description:
 */
public class Client {
    public static void main(String[] args) {
        BookCollection bookCollection = new ConcreteBookCollection();
        bookCollection.add(new Book("book1"));
        bookCollection.add(new Book("book2"));
        bookCollection.add(new Book("book3"));

        BookIterator iterator = bookCollection.createIterator();
        while (iterator.hasNext()){
            System.out.println(iterator.next());
        }
    }
}
